home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / gcc / gcc261c.zoo / objects / EltNodeCollector.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-18  |  2.0 KB  |  68 lines

  1. /* Interface for Objective-C EltNodeCollector collection object
  2.    Copyright (C) 1993,1994 Free Software Foundation, Inc.
  3.  
  4.    Written by:  R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
  5.    Date: May 1993
  6.  
  7.    This file is part of the GNU Objective C Class Library.
  8.  
  9.    This library is free software; you can redistribute it and/or
  10.    modify it under the terms of the GNU Library General Public
  11.    License as published by the Free Software Foundation; either
  12.    version 2 of the License, or (at your option) any later version.
  13.    
  14.    This library is distributed in the hope that it will be useful,
  15.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17.    Library General Public License for more details.
  18.  
  19.    You should have received a copy of the GNU Library General Public
  20.    License along with this library; if not, write to the Free
  21.    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. */ 
  23.  
  24. /* EltNodeCollector */
  25.  
  26. #ifndef __EltNodeCollector_h_INCLUDE_GNU
  27. #define __EltNodeCollector_h_INCLUDE_GNU
  28.  
  29. #include <objects/stdobjects.h>
  30. #include <objects/IndexedCollection.h>
  31.  
  32. /* Protocol for a node that also holds an element */
  33. @protocol EltHolding
  34. - initElement: (elt)anElement 
  35.     encoding: (const char *)eltEncoding;
  36. - (elt) elementData;
  37. @end
  38.  
  39.  
  40. /* It's is a bit unfortunate that we insist that the underlying
  41.    collector conform to IndexedCollecting. */
  42.  
  43. @interface EltNodeCollector : IndexedCollection
  44. {
  45.   @private
  46.   id _contents_collector;
  47.   id _node_class;
  48.   int (*_comparison_function)(elt,elt);
  49. }
  50.  
  51.  
  52. - initWithType: (const char *)contentEncoding
  53.     nodeCollector: aNodeCollector
  54.     nodeClass: aNodeClass;
  55.  
  56. // The class of the autocreated link objects, must conform to <EltHolding>;
  57. - eltNodeClass;
  58.  
  59. // Getting the underlying node collector that holds the contents;
  60. - contentsCollector;
  61.  
  62. // Finding the node that contains anElement;
  63. - (id <EltHolding>) eltNodeWithElement: (elt)anElement;
  64.  
  65. @end
  66.  
  67. #endif /* __EltNodeCollector_h_INCLUDE_GNU */
  68.